package com.jvm;

import java.io.IOException;

public class Visibility {

    private static boolean running=true;

    public static void m(){
        System.out.println("m start");
        while (running){
//            System.out.println("hello");
        }
        System.out.println("m end");
    }

    public static void main(String[] args) {
        new Thread(Visibility::m,"t1").start();
        try {
            Thread.sleep(1000);
            running=false;
//            try {
//                System.in.read();
//            } catch (IOException e) {
//                e.printStackTrace();
//            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
